package com.resou.reader.bookstore.rank.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.CheckedTextView;

import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.resou.reader.api.entry.RankTypeBean;

import java.util.List;

import com.resou.reader.R;
import com.resou.reader.mine.IView.UserInstance;

/**
 * Author: 萤火虫
 * E-mail:  Allensuns@163.com
 * Description: 排行榜榜类型适配器
 * CreateTime: 2019-04 -09
 **/
public class RankTypeAdadpter extends BaseQuickAdapter<RankTypeBean, BaseViewHolder> {

    public RankTypeAdadpter(int layoutResId, @Nullable List<RankTypeBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, RankTypeBean item) {
        helper.setText(R.id.ctvLabel, item.getRankName() + "");
        if (item.isCheck()) {
            helper.setVisible(R.id.mView, true);
            helper.setChecked(R.id.ctvLabel, true);
        } else {
            helper.setVisible(R.id.mView, false);
            helper.setChecked(R.id.ctvLabel, false);
        }
        helper.addOnClickListener(R.id.ctvLabel);
    }

}
